#!/bin/bash


echo "default=$(pactl get-default-sink)"
while read line; do
	if [[ "$line" =~ Name: ]];then
		echo "name=${line##*: }"
	elif [[ "$line" =~ Mute: ]];then
		echo "mute=${line##*: }"
	elif [[ "$line" =~ front-left: ]];then
		line="${line#*/}"
		line="${line%%%*}"
		echo "volume=${line##* }"
	elif [[ "$line" =~ alsa.card_name ]];then
		echo "card=${line##*= }"
	elif [[ "$line" =~ type: ]];then
		line="${line#*: }"
		echo "type=${line%%(*}"
	fi
done <<<"$(pactl list sinks | grep -E 'Name:|Mute:|front-left:|alsa.card_name|type:')"
